#include <iostream>
#include <cstring>
using namespace std;


bool check(char* line, int start, int length) {
//System.out.println("checking: " + new String(line, start, length - start));

		if (start == length) return false;
		
//	if ("".equals(line)) return false;
		
		if (length - start == 1) 
		
			if ('p' == line[start] || 
				'q'== line[start] ||
				'r'== line[start] ||
				's'== line[start] ||
				't'== line[start] ||
				'u'== line[start] ||
				'v'== line[start] ||
				'w'== line[start] ||
				'x'== line[start] ||
				'y'== line[start] ||
				'z'== line[start] 
			) return true;
		
		if (line[start] == 'N' && length - start > 1)
			return check(line, start + 1, length);

		
		bool b = false;
		char c = line[start];
		
		if (c == 'C' || c == 'D' || c == 'E' || c == 'I') {
            		int subStart = start+1;

            		for (int k = subStart + 1; k < length; k++) {
            	
                    		if (check (line, subStart, k) && check(line, k, length)) return true;

            		}

			
		}
		
		return false;
	}



bool is(char *p) {

   return check(p,0, strlen(p));

}


int main() {
	char s[1000];
	while(cin.getline(s,1000))
		{
		if(is(s))
			cout<<"YES\n";
		else
			cout<<"NO\n";
		}
		return 0;
	}
